{% extends "layout.html" %}

{% block head %}
<title>{{ _(config["WEBSITE_NAME"]) }} - {{ _(title) }}</title>
<meta name="robots" content="index">
<meta name="description" content="{{ _('List of all uruk wiki posts avaliable.') }}">
{% endblock %}

{% block body %}
<div class="row">
	<div class="container-fluid">
		{% include "wiki/search_bar.html" %}
		{% include "wiki/aside.html" %}		
		{{ toolbar(edit=False, delete=False, add=True) }}	
		<section id="content">
			<div class="pull-left col-sm-10 col-xs-12">
				{% if len(query) == 0 %}
					<h2>{{ _("Nothing founded") }}</h2>
				{% else %}
					{% for el in query %}
						<h2 style="margin-left: 20px; margin-bottom: 10px !important"><a href="{{ url_for('wiki.post', post=el.url) }}">{{ el.address }}</a></h2>
						<p style="margin-left: 40px;">
							{% if len(sub("<.*?>", " ", el.content)) <= 100 %}
								{{ sub("<.*?>", " ", el.content) }}
							{% else %}
								{{ sub("<.*?>", " ", el.content)[:100] }}...
							{% endif %}
						</p>
					{% endfor %}
				{% endif %}
			</div>
		</section>
	</div>
</div>
{% endblock %}